package Test;
import java.util.Scanner;

public class Student {
    public static void main(String[] args) {
        /*初始化操作*/
        System.out.println("请输入学生个数");
        Scanner input1 = new Scanner(System.in);
        int num = input1.nextInt();
        String[] sname=new String[num];
        int cnscore[]=new int[num];
        int mnscore[]=new int[num];
        int enscore[]=new int[num];
        String[] level=new String[num];
        double[] ave=new double[num];
        int[] sum=new int[num];
        /*录入信息并存储*/
        for (int i=0; i < num; i++) {
            i++;
            System.out.println("请输入第"+i+"位同学的名字");
            --i;
            Scanner input2=new Scanner(System.in);
            sname[i]=input2.nextLine();
            System.out.println("请输入该同学的语文成绩");
            Scanner input3=new Scanner(System.in);
            cnscore[i]=input3.nextInt();
            System.out.println("请输入该同学的数学成绩");
            Scanner input4=new Scanner(System.in);
            mnscore[i]=input4.nextInt();
            System.out.println("请输入该同学的英语成绩");
            Scanner input5=new Scanner(System.in);
            enscore[i]=input5.nextInt();
            /*计算平均值和等级*/
             sum[i]=cnscore[i]+mnscore[i]+enscore[i];
             ave[i]=sum[i]/3;
            if(ave[i]<60)
                level[i]="E";
            else if(ave[i]<70)
                level[i]="D";
            else if(ave[i]<80)
                level[i]="C";
            else if(ave[i]<90)
                level[i]="B";
            else if(ave[i]<=100)
                level[i]="A";
        }
        /*输出结果*/
        for(int i=0;i<num;i++){
        System.out.print("学生姓名：  "+sname[i]);
        System.out.print("  平均分：  "+ave[i]);
        System.out.println("  等级："+level[i]);
        }
    }
}